<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::DoublePole Class Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="classshark_1_1_double_pole.html">DoublePole</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="classshark_1_1_double_pole-members.html">List of all members</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle"><div class="title">shark::DoublePole Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="_double_pole_8h_source.html">shark/ObjectiveFunctions/Benchmarks/PoleSimulators/DoublePole.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a623d1c62e55c3df3a1c7219cefac3940" id="r_a623d1c62e55c3df3a1c7219cefac3940"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_double_pole.html#a623d1c62e55c3df3a1c7219cefac3940">noVars</a> () const</td></tr>
<tr class="memdesc:a623d1c62e55c3df3a1c7219cefac3940"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of variables.  <br /></td></tr>
<tr class="separator:a623d1c62e55c3df3a1c7219cefac3940"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ab1e7c4c87e91b6a435473488b24b94" id="r_a7ab1e7c4c87e91b6a435473488b24b94"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_double_pole.html#a7ab1e7c4c87e91b6a435473488b24b94">DoublePole</a> (bool markovian, bool normalize=true)</td></tr>
<tr class="separator:a7ab1e7c4c87e91b6a435473488b24b94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70cf32c8d658c4b6d55fc229c2e9226e" id="r_a70cf32c8d658c4b6d55fc229c2e9226e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_double_pole.html#a70cf32c8d658c4b6d55fc229c2e9226e">getState</a> (RealVector &amp;v)</td></tr>
<tr class="memdesc:a70cf32c8d658c4b6d55fc229c2e9226e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Place m_state in a vector.  <br /></td></tr>
<tr class="separator:a70cf32c8d658c4b6d55fc229c2e9226e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b14136fc5153dcd09160d81a432fa81" id="r_a3b14136fc5153dcd09160d81a432fa81"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_double_pole.html#a3b14136fc5153dcd09160d81a432fa81">init</a> (double state2init=0.07)</td></tr>
<tr class="memdesc:a3b14136fc5153dcd09160d81a432fa81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize with specific angle for large pole.  <br /></td></tr>
<tr class="separator:a3b14136fc5153dcd09160d81a432fa81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89b7eaa944fae019602a677a834eaba8" id="r_a89b7eaa944fae019602a677a834eaba8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_double_pole.html#a89b7eaa944fae019602a677a834eaba8">initDegree</a> (double state2init)</td></tr>
<tr class="memdesc:a89b7eaa944fae019602a677a834eaba8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize with specific angle for large pole.  <br /></td></tr>
<tr class="separator:a89b7eaa944fae019602a677a834eaba8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ab0da8d67c1bdd2987615a1fb25a3f6" id="r_a0ab0da8d67c1bdd2987615a1fb25a3f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_double_pole.html#a0ab0da8d67c1bdd2987615a1fb25a3f6">init</a> (double a, double b, double c, double d, double e=0., double f=0.)</td></tr>
<tr class="memdesc:a0ab0da8d67c1bdd2987615a1fb25a3f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize full m_state.  <br /></td></tr>
<tr class="separator:a0ab0da8d67c1bdd2987615a1fb25a3f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac24a26634511052a94f55986507ed70a" id="r_ac24a26634511052a94f55986507ed70a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_double_pole.html#ac24a26634511052a94f55986507ed70a">failure</a> ()</td></tr>
<tr class="memdesc:ac24a26634511052a94f55986507ed70a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true when this pole is in an illegal position.  <br /></td></tr>
<tr class="separator:ac24a26634511052a94f55986507ed70a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47aae9cea93635b74c06f27427258a1a" id="r_a47aae9cea93635b74c06f27427258a1a"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_double_pole.html#a47aae9cea93635b74c06f27427258a1a">getJiggle</a> ()</td></tr>
<tr class="memdesc:a47aae9cea93635b74c06f27427258a1a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return "jiggle", abstract representation of how much the the cart oscillates.  <br /></td></tr>
<tr class="separator:a47aae9cea93635b74c06f27427258a1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95065838bc7f6ceb3fa85ae568bc9def" id="r_a95065838bc7f6ceb3fa85ae568bc9def"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_double_pole.html#a95065838bc7f6ceb3fa85ae568bc9def">move</a> (double output)</td></tr>
<tr class="memdesc:a95065838bc7f6ceb3fa85ae568bc9def"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the pole with some force.  <br /></td></tr>
<tr class="separator:a95065838bc7f6ceb3fa85ae568bc9def"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p class="definition">Definition at line <a class="el" href="_double_pole_8h_source.html#l00048">48</a> of file <a class="el" href="_double_pole_8h_source.html">DoublePole.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a7ab1e7c4c87e91b6a435473488b24b94" name="a7ab1e7c4c87e91b6a435473488b24b94"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ab1e7c4c87e91b6a435473488b24b94">&#9670;&#160;</a></span>DoublePole()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">shark::DoublePole::DoublePole </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>markovian</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>normalize</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">markovian</td><td>Whether to return velocities in getState </td></tr>
    <tr><td class="paramname">normalize</td><td>Whether to normalize return values in getState </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_double_pole_8h_source.html#l00060">60</a> of file <a class="el" href="_double_pole_8h_source.html">DoublePole.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ac24a26634511052a94f55986507ed70a" name="ac24a26634511052a94f55986507ed70a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac24a26634511052a94f55986507ed70a">&#9670;&#160;</a></span>failure()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool shark::DoublePole::failure </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns true when this pole is in an illegal position. </p>

<p class="definition">Definition at line <a class="el" href="_double_pole_8h_source.html#l00129">129</a> of file <a class="el" href="_double_pole_8h_source.html">DoublePole.h</a>.</p>

</div>
</div>
<a id="a47aae9cea93635b74c06f27427258a1a" name="a47aae9cea93635b74c06f27427258a1a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a47aae9cea93635b74c06f27427258a1a">&#9670;&#160;</a></span>getJiggle()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double shark::DoublePole::getJiggle </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return "jiggle", abstract representation of how much the the cart oscillates. </p>

<p class="definition">Definition at line <a class="el" href="_double_pole_8h_source.html#l00143">143</a> of file <a class="el" href="_double_pole_8h_source.html">DoublePole.h</a>.</p>

</div>
</div>
<a id="a70cf32c8d658c4b6d55fc229c2e9226e" name="a70cf32c8d658c4b6d55fc229c2e9226e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70cf32c8d658c4b6d55fc229c2e9226e">&#9670;&#160;</a></span>getState()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::DoublePole::getState </td>
          <td>(</td>
          <td class="paramtype">RealVector &amp;&#160;</td>
          <td class="paramname"><em>v</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Place m_state in a vector. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">v</td><td>vector to place m_state in (assumed to be correct size already) </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_double_pole_8h_source.html#l00082">82</a> of file <a class="el" href="_double_pole_8h_source.html">DoublePole.h</a>.</p>

</div>
</div>
<a id="a0ab0da8d67c1bdd2987615a1fb25a3f6" name="a0ab0da8d67c1bdd2987615a1fb25a3f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ab0da8d67c1bdd2987615a1fb25a3f6">&#9670;&#160;</a></span>init() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::DoublePole::init </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>e</em> = <code>0.</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>f</em> = <code>0.</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Initialize full m_state. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>initial cart position </td></tr>
    <tr><td class="paramname">b</td><td>initial cart velocity </td></tr>
    <tr><td class="paramname">c</td><td>initial large pole angle (in radians) </td></tr>
    <tr><td class="paramname">d</td><td>initial large pole angular velocity </td></tr>
    <tr><td class="paramname">e</td><td>initial small pole angle (in radians) </td></tr>
    <tr><td class="paramname">f</td><td>initial small pole angular velocity </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_double_pole_8h_source.html#l00119">119</a> of file <a class="el" href="_double_pole_8h_source.html">DoublePole.h</a>.</p>

</div>
</div>
<a id="a3b14136fc5153dcd09160d81a432fa81" name="a3b14136fc5153dcd09160d81a432fa81"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b14136fc5153dcd09160d81a432fa81">&#9670;&#160;</a></span>init() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::DoublePole::init </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>state2init</em> = <code>0.07</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Initialize with specific angle for large pole. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">state2init</td><td>initial pole angle (in radians) </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_double_pole_8h_source.html#l00101">101</a> of file <a class="el" href="_double_pole_8h_source.html">DoublePole.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_double_pole.html#a89b7eaa944fae019602a677a834eaba8">initDegree()</a>.</p>

</div>
</div>
<a id="a89b7eaa944fae019602a677a834eaba8" name="a89b7eaa944fae019602a677a834eaba8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89b7eaa944fae019602a677a834eaba8">&#9670;&#160;</a></span>initDegree()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::DoublePole::initDegree </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>state2init</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Initialize with specific angle for large pole. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">state2init</td><td>initial pole angle (in degrees) </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_double_pole_8h_source.html#l00108">108</a> of file <a class="el" href="_double_pole_8h_source.html">DoublePole.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_double_pole.html#a3b14136fc5153dcd09160d81a432fa81">init()</a>.</p>

</div>
</div>
<a id="a95065838bc7f6ceb3fa85ae568bc9def" name="a95065838bc7f6ceb3fa85ae568bc9def"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a95065838bc7f6ceb3fa85ae568bc9def">&#9670;&#160;</a></span>move()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::DoublePole::move </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>output</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Move the pole with some force. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">output</td><td>Force to apply. Expects values in [0,1], where values below 0.5 indicate applying force towards the left side and values above indicate force towards the right. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_double_pole_8h_source.html#l00149">149</a> of file <a class="el" href="_double_pole_8h_source.html">DoublePole.h</a>.</p>

</div>
</div>
<a id="a623d1c62e55c3df3a1c7219cefac3940" name="a623d1c62e55c3df3a1c7219cefac3940"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a623d1c62e55c3df3a1c7219cefac3940">&#9670;&#160;</a></span>noVars()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">unsigned shark::DoublePole::noVars </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Number of variables. </p>

<p class="definition">Definition at line <a class="el" href="_double_pole_8h_source.html#l00052">52</a> of file <a class="el" href="_double_pole_8h_source.html">DoublePole.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/shark/ObjectiveFunctions/Benchmarks/PoleSimulators/<a class="el" href="_double_pole_8h_source.html">DoublePole.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
